bitkeeper revision 1.587 (3fafd0aetHCEr89pQ3yPEASCbKFapg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 10 Nov 2003 17:53:50 +0000 (17:53 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 10 Nov 2003 17:53:50 +0000 (17:53 +0000)
xen_netwatch_redhatscript:
  new file
xen_netwatch.c:
  More xen_netwatch fixes.

.rootkeys
tools/misc/xen_netwatch.c
tools/misc/xen_netwatch_redhatscript [new file with mode: 0755]

index e3a2af66276dd9e4cb4a3dad9c1a8dab1a37c6c2..50045fa3b5ee1de587202b58e979bb8175c6eaa4 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 3f13d81eQ9Vz-h-6RDGFkNR9CRP95g tools/misc/xen_nat_enable
 3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README
 3fafbef1fJFKCcJLq-ffpauvpM10jQ tools/misc/xen_netwatch.c
+3fafd0abTbQjsCr5W3DDyNdqdJezrA tools/misc/xen_netwatch_redhatscript
 3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c
 3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c
 3f72f1bdJPsV3JCnBqs9ddL9tr6D2g xen/COPYING
index d6624d5e30a430a001948939b2081b032a20b5b4..9e1194e3293df6275aeaf37ccbea1ae9f1d6c54e 100644 (file)
@@ -30,8 +30,8 @@
 #include <unistd.h>
 #include <time.h>
 
-#define DEFAULT_SCRIPT  "/var/xen/netwatch"
-#define DEFAULT_LOGFILE "/etc/xen/netwatch"
+#define DEFAULT_SCRIPT  "/etc/xen/netwatch"
+#define DEFAULT_LOGFILE "/var/xen/netwatch"
 
 #define LOG(_f, _a...)                                  \
     do {                                                \
diff --git a/tools/misc/xen_netwatch_redhatscript b/tools/misc/xen_netwatch_redhatscript
new file mode 100755 (executable)
index 0000000..1104abd
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Example xen_netwatch script for Red Hat systems.
+# If the network interface goes up or down then standard Red Hat
+# scripts are executed. This may be necessary to reconfigure default
+# routes, for example.
+#
+# This script should be placed at /etc/xen/netwatch
+# You should make sure that the directory /var/xen/ exists.
+#
+# Something like the follwoing should be placed in a startup script
+# such as /etc/rc.d/rc.local:
+#
+# if [ -x /usr/bin/xen_netwatch ]; then
+#     if [ -a /etc/xen/netwatch ]; then
+#         mkdir -p /var/xen
+#         /usr/bin/xen_netwatch
+#     fi
+# fi
+
+cd /etc/sysconfig/network-scripts || exit 1
+
+if [ "x$2" == "xup" ]; then
+        if [ -x ./ifup ]; then
+                ./ifup $1
+        fi
+fi
+
+if [ "x$2" == "xdown" ] ; then
+        if [ -x ./ifdown ]; then
+                ./ifdown $1
+        fi
+fi